﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Torimi.Wiki.DataObjects;

namespace Torimi.Wiki.Interfaces
{
	/// <summary>
	/// The IWiki interface.
	/// </summary>
	public interface IWiki
	{
		/// <summary>
		/// Gets the page.
		/// </summary>
		/// <param name="id">The id.</param>
		/// <returns></returns>
		WikiPage GetPage(Guid id);

		/// <summary>
		/// Gets the page by it's name.  The name as used in the query string.
		/// </summary>
		/// <param name="name">The name.</param>
		/// <returns></returns>
		WikiPage GetPage(string name);

		/// <summary>
		/// Gets all pages.
		/// </summary>
		/// <returns></returns>
		IQueryable<WikiPage> GetAllPages();

		/// <summary>
		/// Adds the page.
		/// </summary>
		/// <param name="page">The page.</param>
		void AddPage(WikiPage page);

		/// <summary>
		/// Updates the page.
		/// </summary>
		/// <param name="page">The page.</param>
		void UpdatePage(WikiPage page);

		/// <summary>
		/// Deletes the page.
		/// </summary>
		/// <param name="id">The id.</param>
		void DeletePage(Guid id);

		/// <summary>
		/// Searches the specified keywords.
		/// </summary>
		/// <param name="keywords">The keywords.</param>
		/// <param name="skip">The skip.</param>
		/// <param name="take">The take.</param>
		/// <param name="category">The category.</param>
		/// <returns></returns>
		IQueryable<SearchResult> Search(string keywords, int skip, int take, Category category);

		/// <summary>
		/// Gets the category.
		/// </summary>
		/// <param name="id">The id.</param>
		/// <returns></returns>
		Category GetCategory(Guid id);

		/// <summary>
		/// Adds the category.
		/// </summary>
		/// <param name="category">The category.</param>
		void AddCategory(Category category);

		/// <summary>
		/// Updates the category.
		/// </summary>
		/// <param name="category">The category.</param>
		void UpdateCategory(Category category);

		/// <summary>
		/// Deletes the category.
		/// </summary>
		/// <param name="id">The id.</param>
		void DeleteCategory(Guid id);

		/// <summary>
		/// Gets all categories.
		/// </summary>
		/// <returns></returns>
		IQueryable<Category> GetAllCategories();

		/// <summary>
		/// Temporary method used during development only.
		/// </summary>
		void ClearEverything();
	}
}